<?php
//设置网页编码
header('Content-type:text/html;charset=utf-8');
//开启session
session_start();
//包含网站配置文件
include '../public/wzconfig.php';
//包含数据库配置文件
include '../public/dbconfig.php';
//包含函数库文件
include '../public/functions.php';
//调用函数 链接数据库
$link = con();
//调用验证码函数
$yzmstr = yzm();
//将其保存至session
$_SESSION['yzmstr'] = $yzmstr;
?>
<div id="header">
<div class="hr">
	<div class="header_top_left">设为主页 收藏本站</div>
	<div class="header_top_right">切换到宽版</div>
</div>
<!--logo1-->
<div class="header_logo1">
	<img src="images/160051ykknktapaokiaazc.gif">
</div>
<div class="clear"></div>
<!--logo2 与 登录区域-->
<div class="header_center">
	<img src="./images/<?php echo WZ_LOGO;?>">
	<?php
	if(isset($_SESSION['username'])){
		//准备sql
		$usql = "select id,username,pic,qx,money from user where id={$_SESSION['id']}";
		//执行sql
		$ures = mysqli_query($link, $usql);
		//判断
		if($ures && mysqli_num_rows($ures)){
			$info = mysqli_fetch_assoc($ures);
		}
		if($_SESSION['qx'] == 1){
	?>
		<div>
			<div id="uinfo">
					<div style="float:right;">
						<?php
						if($info['pic'] == 'default.jpg'){
						?>
							<img src="../images/<?php echo $info['pic']?>">
						<?php	
						}else{
						?>
							<img src="../images/s_<?php echo $info['pic']?>">
						<?php
						}
						?>
					</div>
				<ul>
					<li><a href="./outlogin.php">退出</a></li>
					<li> | </li>
					<li><a href="./set.php">个人资料</a></li>
					<li> | </li>
					<li><a href="./modifypass.php">修改密码</a></li>
					<li> | </li>
					<li><a href="./set.php"><?php echo $info['username']?></a>在线</li><br><br>
					
				</ul>
			</div>
				<div style="float:right;margin-top:10px;margin-right:10px;">人名币：<?php echo $info['money']?></div>
		</div>
	<?php
		}else{
	?>		
		<div>
			<div id="uinfo">
					<div style="float:right;">
						<?php
						if($info['pic'] == 'default.jpg'){
						?>
							<img src="../images/<?php echo $info['pic']?>">
						<?php	
						}else{
						?>
							<img src="../images/s_<?php echo $info['pic']?>">
						<?php
						}
						?>
					</div>
				<ul>
					<li><a href="./outlogin.php">退出</a></li>
					<li> | </li>
					<li><a href="./set.php">个人资料</a></li>
					<li> | </li>
					<li><a href="../admin.php">管理中心</a></li>
					<li> | </li>
					<li><a href="./modifypass.php">修改密码</a></li>
					<li> | </li>
					<li><a href="./set.php"><?php echo $info['username']?></a>在线</li><br><br>
					
				</ul>
			</div>
				<div style="float:right;margin-top:10px;margin-right:10px;">人名币：<?php echo $info['money']?></div>
		</div>
	<?php
		}
	//释放结果集
	mysqli_free_result($ures);
	}else{					
	?>
		<form method="post" action="dologin.php" class="form1">
			<table>
				<tr>
					<td>账号</td>
					<td><input type="text" name="username"></td>
					<td><input type="checkbox" name="zidongdenglu" value="自动登录">自动登录</td>
					<td><a href="###">找回密码<a></td>
				</tr>
				<tr>
					<td>密码</td>
					<td><input type="password" name="pwd"></td>
					<td><input type="submit" value="立即登录"></td>
					<td><a href="register.php">立即注册</a></td>
				</tr>
			</table>
		</form>
	<?php
	}
	?>
</div>
<div class="clear"></div>
<!--导航条-->
<div class="header_menu">
	<ul>
		<li><a href="index.php">论坛首页</a></li>
	</ul>
</div>
<div class="clear"></div>
<!--热搜-->
<div id="search">
	<div class="search1">
		<div class="search1_img">
			<form method="post" action="search.php">
				请输入帖子标题：<input type="text" name="title" class="t1">
				<input type="submit" value="搜索" class="s1">
			</form>
		</div>
	</div>
	<div class="search2">
		<ul>
			<li>热搜：</li>
			<li><a href="##">交友</a></li>
			<li><a href="##">教育</a></li>
			<li><a href="##">幽默</a></li>
			<li><a href="##">搞笑</a></li>
			<li><a href="##">房产</a></li>
			<li><a href="##">购物</a></li>
			<li><a href="##">二手</a></li>
			<li><a href="##">衣服</a></li>
			<li><a href="##">鞋子</a></li>
			<li><a href="##">帮助</a></li>
			<li><a href="##">折扣</a></li>
			<li><a href="##">电影</a></li>
		</ul>
	</div>
</div>
<div class="clear"></div>
<div class="main_a"></div>
<div class="main_b"></div>
<div class="main_c">论坛</div>
</div>
<div class="clear"></div>